package fr.cdj.thebox.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.RootPanel;

import fr.cdj.thebox.client.app.TheboxPresenter;
import fr.cdj.thebox.client.gin.TheboxGInjector;
import fr.cdj.thebox.client.resources.TheboxBundle;

public class Thebox implements EntryPoint {

	private TheboxGInjector injector;
	private TheboxPresenter mainPresenter;

	@Override
	public void onModuleLoad() {
		injector = TheboxGInjector.Util.getInstance();
		
		TheboxBundle resource = GWT.create(TheboxBundle.class);
		resource.getStyle().ensureInjected();
		
		mainPresenter = injector.getMainPresenter();

		mainPresenter.bind();
		mainPresenter.revealDisplay();

		RootPanel.get().add(mainPresenter.getDisplay().asWidget());
	}
}
